const pkg = require('./package')

module.exports = {
  mode: 'universal',

  /*
  ** Headers of the page
  */
  head: {
    title: pkg.name,
    meta: [
      { charset: 'utf-8' },
      {
        name: 'viewport',
        content: 'width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,viewport-fit=cover'
      },
      { hid: 'description', name: 'description', content: pkg.description }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ],
    script: [
      { src: 'http://g.tbcdn.cn/mtb/lib-flexible/0.3.2/??flexible_css.js,flexible.js' }
    ],
    // 不对<script>标签中内容做转义处理
    __dangerouslyDisableSanitizers: ['script']
  },

  /*
  ** Customize the progress-bar color
  */
  loading: { color: '#fff' },

  /*
  ** Global CSS
  */

  css: [
    'swiper/dist/css/swiper.css',
    'mint-ui/lib/style.css',
    'video.js/dist/video-js.css'
  ],
  /*
  ** Plugins to load before mounting the App
  */

  plugins: [
    { src: '~/plugins/swiper.js', ssr: false },
    { src: '~plugins/mint-ui.js', ssr: true },
    { src: '~plugins/nuxt-video.js', ssr: true },
    { src: '~plugins/element-ui.js', ssr: true },
    '~plugins/axios.js'
  ],

  /*
  ** Nuxt.js modules
  */
  modules: [
    // Doc: https://github.com/nuxt-community/axios-module#usage
    '@nuxtjs/axios'
    // 'cookie-universal-nuxt',
    // // With options
    // ['cookie-universal-nuxt', { alias: 'cookiz' }]
  ],
  /*
  ** Axios module configuration
  */
  axios: {
    // baseURL: 'http://dev.api.famlink.co', //开发环境
    //baseURL: "", //线下
    //baseURL:"http://local.control.famlink.co", //线下
    //baseURL:"http://control.famlink.co", //线下
    //baseURL:"http://manage.famlink.co", //线上
    //baseURL: "http://alpha.manage.famlink.co", //测试环境
    // proxy: true
  },
  proxy: {
    // '/': 'http://dev.api.famlink.co'
  },
  /*
  ** Build configuration
  */
  build: {
    /*
    ** You can extend webpack config here
    */
    vendor: ['axios', 'vuex', 'mint-ui', 'element-ui'],
    postcss: [
      require('postcss-px2rem')({
        remUnit: 75
      })
    ],
    babel: {
      // 'plugins': [['component', [
      //   {
      //     'libraryName': 'element-ui',
      //     'styleLibraryName': 'theme-default'
      //   },
      //   'transform-async-to-generator',
      //   'transform-runtime'
      // ]]],
      // comments: true
      // 'presets': [
      //   ['es2015', { 'modules': false }]
      // ],
      // 'plugins': [['component', [
      //   {
      //     'libraryName': 'mint-ui',
      //     'style': true
      //   }
      // ]]]
    },
    extend(config, ctx) {

    }
  }
}
